using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;

using Microsoft.Practices.EnterpriseLibrary.Logging;

namespace SBPweb.Logging
{
    public static partial class LogManager
    {
        /*
         **Critical Fatal error or application crash.
         **Error Recoverable error.
         **Information Informational message.
         **Verbose Debugging trace.
         **Warning Noncritical problem.
        */

        private const int DEFAULTPRIORITY = -1;
        private const TraceEventType DEFAULTSEVERITY = TraceEventType.Information;
        private const int DEFAULTEVENTID = 1;
        private const string DEFAULTTITLE = "";
        private static readonly ICollection<string> EMPTYCATEGORYLIST = new List<string>(0);

        #region Generic writers

        /// <summary>
        /// Writes a new log entry.
        /// </summary>
        /// <param name="log">Log entry object to write.</param>
		/// <param name="skipGlobalImplicitCategories">Do not log event to global implicit categories</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void Write(LogEntry log, Boolean skipGlobalImplicitCategories)
        {
                if (!mInitialized)
                {
                    return;
                    //throw new InvalidOperationException("The logger has not been initialized!");
                }

				if (!mEnableWriter)
				{
					return;
				}

                #region Adding implicit categories

				if (!skipGlobalImplicitCategories && !DisableGlobalImplicitCategories)
				{
					Dictionary<String, int> implicitcategories;
					lock (mImplicitCategories)
					{

						if (!mImplicitCategories.TryGetValue(Thread.CurrentThread.ManagedThreadId, out implicitcategories))
							implicitcategories = null;

						List<String> categories;

						if (implicitcategories != null)
						{
							categories = new List<string>(implicitcategories.Count + (log.Categories != null ? log.Categories.Count : 0));
							categories.AddRange(implicitcategories.Keys);
						}
						else
						{
							categories = new List<string>(log.Categories != null ? log.Categories.Count : 0);
						}

						// Adding global implicit categories
						foreach (String category in mGlobalImplicitCategories)
						{
							if (!categories.Contains(category))
							{
								categories.Add(category);
							}
						}

						// Adding explicit categories
						foreach (String category in log.Categories)
						{
							if (!categories.Contains(category))
							{
								categories.Add(category);
							}
						}

						log.Categories = categories;
					}
				}

                #endregion

                #region Filtering categories

                List<String> nonfilteredcategories = new List<string>(log.Categories.Count);
                foreach (String category in log.Categories)
                {
                    try
                    {
                        if ((mCategorySeverityFilters[category] & (SeverityLevel)log.Severity) == 0)
                            nonfilteredcategories.Add(category);
                    }
                    catch (KeyNotFoundException)
                    {
                        // Category severity filter was not defined
                        if ((mFallbackSeverityFilter & (SeverityLevel)log.Severity) == 0)
                            nonfilteredcategories.Add(category);
                    }
                }

                log.Categories = nonfilteredcategories;

				#endregion

				#region Creating category keyword

				string categoryKeywordValue = string.Empty;
				foreach (string category in nonfilteredcategories)
				{
					if (string.IsNullOrEmpty(categoryKeywordValue))
					{
						categoryKeywordValue = string.Concat(nonfilteredcategories.Count > 1 ? "Categories: " : "Category: ", category);
					}
					else
					{
						categoryKeywordValue = string.Concat(categoryKeywordValue, ",", category);
					}
				}

                #endregion

                #region Adding keywords

                Dictionary<String, int> keywords;

                lock (mKeywords)
                {
					if (!mKeywords.TryGetValue(Thread.CurrentThread.ManagedThreadId, out keywords))
					{
						keywords = new Dictionary<string, int>();
					}
					if (log.ExtendedProperties == null)
					{
						log.ExtendedProperties = new Dictionary<string, object>();
					}
					if ((!log.ExtendedProperties.ContainsKey("Keywords")) || !(log.ExtendedProperties["Keywords"] is ICollection<string>))
					{
						log.ExtendedProperties.Add("Keywords", new List<string>());
					}

					(log.ExtendedProperties["Keywords"] as ICollection<string>).Add(categoryKeywordValue); 
					foreach (string key in keywords.Keys)
					{
						(log.ExtendedProperties["Keywords"] as ICollection<string>).Add(key);
					}
                }

                #endregion

                mLogWriter.Write(log);
        }

        /// <summary>
        /// Writes a new log entry to the default category.
        /// </summary>
        /// <param name="Format">Format string for the log message string.</param>
        /// <param name="Parameters">Parameters to format into the format string.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteF(String Format, params Object[] Parameters)
        {
            Write(String.Format(Format, Parameters), EMPTYCATEGORYLIST, DEFAULTPRIORITY, DEFAULTEVENTID, DEFAULTSEVERITY, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new log entry to the default category.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void Write(object message)
        {
            Write(message, EMPTYCATEGORYLIST, DEFAULTPRIORITY, DEFAULTEVENTID, DEFAULTSEVERITY, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new log entry to a specific category.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>l
        public static void Write(object message, string category)
        {
            Write(message, category, DEFAULTPRIORITY, DEFAULTEVENTID, DEFAULTSEVERITY, DEFAULTTITLE, null);
        }

        /// <summary>
        /// Writes a new log entry with a specific category and priority.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void Write(object message, string category, int priority)
        {
            Write(message, category, priority, DEFAULTEVENTID, DEFAULTSEVERITY, DEFAULTTITLE, null);
        }

        /// <summary>
        /// Writes a new log entry with a specific category, priority and event id.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void Write(object message, string category, int priority, int eventId)
        {
            Write(message, category, priority, eventId, DEFAULTSEVERITY, DEFAULTTITLE, null);
        }

        /// <summary>
        /// Writes a new log entry with a specific category, priority, event id and severity.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="severity">Log entry severity as a <see cref="TraceEventType"/> enumeration. (Unspecified, Information, Warning or Error).</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void Write(object message, string category, int priority, int eventId, TraceEventType severity)
        {
            Write(message, category, priority, eventId, severity, DEFAULTTITLE, null);
        }

        /// <summary>
        /// Writes a new log entry with a specific category, priority, event id, severity and title.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="severity">Log message severity as a <see cref="TraceEventType"/> enumeration. (Unspecified, Information, Warning or Error).</param>
        /// <param name="title">Additional description of the log entry message</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void Write(object message, string category, int priority, int eventId,
                                 TraceEventType severity, string title)
        {
            Write(message, category, priority, eventId, severity, title, null);
        }

        /// <summary>
        /// Write a new log entry and a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void Write(object message, IDictionary<string, object> properties)
        {
            Write(message, EMPTYCATEGORYLIST, DEFAULTPRIORITY, DEFAULTEVENTID, DEFAULTSEVERITY, DEFAULTTITLE, properties, false);
        }

        /// <summary>
        /// Writes a new log entry to a specific category with a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void Write(object message, string category, IDictionary<string, object> properties)
        {
            Write(message, category, DEFAULTPRIORITY, DEFAULTEVENTID, DEFAULTSEVERITY, DEFAULTTITLE, properties);
        }

        /// <summary>
        /// Write a new log entry to with a specific category, priority and a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void Write(object message, string category, int priority, IDictionary<string, object> properties)
        {
            Write(message, category, priority, DEFAULTEVENTID, DEFAULTSEVERITY, DEFAULTTITLE, properties);
        }

        /// <summary>
        /// Writes a new log entry with a specific category, priority, event Id, severity title and dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="severity">Log message severity as a <see cref="TraceEventType"/> enumeration. (Unspecified, Information, Warning or Error).</param>
        /// <param name="title">Additional description of the log entry message.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void Write(object message, string category, int priority, int eventId,
                                 TraceEventType severity, string title, IDictionary<string, object> properties)
        {
            Write(message, new string[] { category }, priority, eventId, severity, title, properties, false);
        }

		/// <summary>
		/// Writes a new log entry with a specific category, priority, event Id, severity title and dictionary of extended properties.
		/// </summary>
		/// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
		/// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
		/// <param name="priority">Only messages must be above the minimum priority are processed.</param>
		/// <param name="eventId">Event number or identifier.</param>
		/// <param name="severity">Log message severity as a <see cref="TraceEventType"/> enumeration. (Unspecified, Information, Warning or Error).</param>
		/// <param name="title">Additional description of the log entry message.</param>
		/// <param name="properties">Dictionary of key/value pairs to log.</param>
		/// <param name="skipGlobalImplicitCategories">Skips to log into Global Implicit Categories for this log entry.</param>
		/// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
		public static void Write(object message, string category, int priority, int eventId,
								 TraceEventType severity, string title, IDictionary<string, object> properties, bool skipGlobalImplicitCategories)
		{
			Write(message, new string[] { category }, priority, eventId, severity, title, properties, skipGlobalImplicitCategories);
		}

        /// <summary>
        /// Write a new log entry to a specific collection of categories.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void Write(object message, ICollection<string> categories)
        {
            Write(message, categories, DEFAULTPRIORITY, DEFAULTEVENTID, DEFAULTSEVERITY, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new log entry with a specific collection of categories and priority.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void Write(object message, ICollection<string> categories, int priority)
        {
            Write(message, categories, priority, DEFAULTEVENTID, DEFAULTSEVERITY, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new log entry with a specific collection of categories, priority and event id.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void Write(object message, ICollection<string> categories, int priority, int eventId)
        {
            Write(message, categories, priority, eventId, DEFAULTSEVERITY, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new log entry with a specific collection of categories, priority, event id and severity.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="severity">Log entry severity as a <see cref="TraceEventType"/> enumeration. (Unspecified, Information, Warning or Error).</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void Write(object message, ICollection<string> categories, int priority, int eventId, TraceEventType severity)
        {
            Write(message, categories, priority, eventId, severity, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new log entry with a specific collection of categories, priority, event id, severity and title.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="severity">Log message severity as a <see cref="TraceEventType"/> enumeration. (Unspecified, Information, Warning or Error).</param>
        /// <param name="title">Additional description of the log entry message</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void Write(object message, ICollection<string> categories, int priority, int eventId,
                                 TraceEventType severity, string title)
        {
            Write(message, categories, priority, eventId, severity, title, null, false);
        }

        /// <summary>
        /// Write a new log entry to a specific collection of categories with a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void Write(object message, ICollection<string> categories, IDictionary<string, object> properties)
        {
			Write(message, categories, DEFAULTPRIORITY, DEFAULTEVENTID, DEFAULTSEVERITY, DEFAULTTITLE, properties, false);
        }

        /// <summary>
        /// Write a new log entry to with a specific collection of categories, priority and a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void Write(object message, ICollection<string> categories, int priority, IDictionary<string, object> properties)
        {
			Write(message, categories, priority, DEFAULTEVENTID, DEFAULTSEVERITY, DEFAULTTITLE, properties, false);
        }

        /// <summary>
        /// Writes a new log entry with a specific category, priority, event Id, severity title and dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="severity">Log message severity as a <see cref="TraceEventType"/> enumeration. (Unspecified, Information, Warning or Error).</param>
        /// <param name="title">Additional description of the log entry message.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
		/// <param name="skipGlobalImplicitCategories">Do not log event to global implicit categories</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void Write(object message, ICollection<string> categories, int priority, int eventId,
                                 TraceEventType severity, string title, IDictionary<string, object> properties, bool skipGlobalImplicitCategories)
        {
            LogEntry log = new LogEntry();
            log.Message = message.ToString();
            log.Categories = categories;
            log.Priority = priority;
            log.EventId = eventId;
            log.Severity = severity;
            log.Title = title;
            log.ExtendedProperties = properties;

			Write(log, skipGlobalImplicitCategories);
        }

        #endregion

        #region Critical

        /// <summary>
        /// Writes a new critical log entry as defined in the <see cref="LogEntry"/> parameter.
        /// </summary>
        /// <param name="log">Log entry object to write.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteCritical(LogEntry log)
        {
            if (log != null)
            {
                log.Severity = TraceEventType.Critical;

                Write(log);
            }
        }

        /// <summary>
        /// Writes a new critical log entry to the default category.
        /// </summary>
        /// <param name="Format">Format string for the log message string.</param>
        /// <param name="Parameters">Parameters to format into the format string.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteCriticalF(String Format, params Object[] Parameters)
        {
			Write(String.Format(Format, Parameters), EMPTYCATEGORYLIST, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Critical, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new critical log entry to the default category.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteCritical(object message)
        {
			Write(message, EMPTYCATEGORYLIST, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Critical, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new critical log entry to a specific category.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteCritical(object message, string category)
        {
            Write(message, category, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Critical, DEFAULTTITLE, null);
        }

		/// <summary>
		/// Writes a new critical log entry to a specific category.
		/// </summary>
		/// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
		/// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
		/// <param name="skipGlobalImplicitCategories">Skips to log into Global Implicit Categories for this log entry.</param>
		/// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
		public static void WriteCritical(object message, string category, bool skipGlobalImplicitCategories)
		{
			Write(message, category, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Critical, DEFAULTTITLE, null, skipGlobalImplicitCategories);
		}

        /// <summary>
        /// Writes a new critical log entry with a specific category and priority.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteCritical(object message, string category, int priority)
        {
            Write(message, category, priority, DEFAULTEVENTID, TraceEventType.Critical, DEFAULTTITLE, null);
        }

        /// <summary>
        /// Writes a new critical log entry with a specific category, priority and event id.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteCritical(object message, string category, int priority, int eventId)
        {
            Write(message, category, priority, eventId, TraceEventType.Critical, DEFAULTTITLE, null);
        }

        /// <summary>
        /// Writes a new critical log entry with a specific category, priority, event id, severity and title.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="title">Additional description of the log entry message</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteCritical(object message, string category, int priority, int eventId, string title)
        {
            Write(message, category, priority, eventId, TraceEventType.Critical, title, null);
        }

        /// <summary>
        /// Writes a new critical log entry and a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteCritical(object message, IDictionary<string, object> properties)
        {
			Write(message, EMPTYCATEGORYLIST, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Critical, DEFAULTTITLE, properties, false);
        }

        /// <summary>
        /// Writes a new critical log entry to a specific category with a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteCritical(object message, string category, IDictionary<string, object> properties)
        {
            Write(message, category, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Critical, DEFAULTTITLE, properties);
        }

        /// <summary>
        /// Writes a new critical log entry to with a specific category, priority and a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteCritical(object message, string category, int priority, IDictionary<string, object> properties)
        {
            Write(message, category, priority, DEFAULTEVENTID, TraceEventType.Critical, DEFAULTTITLE, properties);
        }

        /// <summary>
        /// Writes a new critical log entry with a specific category, priority, event Id, severity title and dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="title">Additional description of the log entry message.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteCritical(object message, string category, int priority, int eventId, string title, IDictionary<string, object> properties)
        {
			Write(message, new string[] { category }, priority, eventId, TraceEventType.Critical, title, properties, false);
        }

        /// <summary>
        /// Writes a new critical log entry to a specific collection of categories.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteCritical(object message, ICollection<string> categories)
        {
			Write(message, categories, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Critical, DEFAULTTITLE, null, false);
        }

		/// <summary>
		/// Writes a new critical log entry to a specific collection of categories.
		/// </summary>
		/// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
		/// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
		/// <param name="skipGlobalImplicitCategories">Skips to log into Global Implicit Categories for this log entry.</param>
		/// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
		public static void WriteCritical(object message, ICollection<string> categories, bool skipGlobalImplicitCategories)
		{
			Write(message, categories, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Critical, DEFAULTTITLE, null, skipGlobalImplicitCategories);
		}

        /// <summary>
        /// Writes a new critical log entry with a specific collection of categories and priority.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteCritical(object message, ICollection<string> categories, int priority)
        {
			Write(message, categories, priority, DEFAULTEVENTID, TraceEventType.Critical, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new critical log entry with a specific collection of categories, priority and event id.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteCritical(object message, ICollection<string> categories, int priority, int eventId)
        {
			Write(message, categories, priority, eventId, TraceEventType.Critical, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new critical log entry with a specific collection of categories, priority, event id, severity and title.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="title">Additional description of the log entry message</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteCritical(object message, ICollection<string> categories, int priority, int eventId, string title)
        {
			Write(message, categories, priority, eventId, TraceEventType.Critical, title, null, false);
        }

        /// <summary>
        /// Writes a new critical log entry to a specific collection of categories with a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteCritical(object message, ICollection<string> categories, IDictionary<string, object> properties)
        {
			Write(message, categories, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Critical, DEFAULTTITLE, properties, false);
        }

		/// <summary>
		/// Writes a new critical log entry to a specific collection of categories with a dictionary of extended properties.
		/// </summary>
		/// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
		/// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
		/// <param name="properties">Dictionary of key/value pairs to log.</param>
		/// <param name="skipGlobalImplicitCategories">Skips to log into Global Implicit Categories for this log entry.</param>
		/// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
		public static void WriteCritical(object message, ICollection<string> categories, IDictionary<string, object> properties, bool skipGlobalImplicitCategories)
		{
			Write(message, categories, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Critical, DEFAULTTITLE, properties, skipGlobalImplicitCategories);
		}

        /// <summary>
        /// Writes a new critical log entry to with a specific collection of categories, priority and a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteCritical(object message, ICollection<string> categories, int priority, IDictionary<string, object> properties)
        {
			Write(message, categories, priority, DEFAULTEVENTID, TraceEventType.Critical, DEFAULTTITLE, properties, false);
        }

        /// <summary>
        /// Writes a new critical log entry with a specific category, priority, event Id, severity title and dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="title">Additional description of the log entry message.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteCritical(object message, ICollection<string> categories, int priority, int eventId, string title, IDictionary<string, object> properties)
        {
            LogEntry log = new LogEntry();
            log.Message = message.ToString();
            log.Categories = categories;
            log.Priority = priority;
            log.EventId = eventId;
            log.Severity = TraceEventType.Critical;
            log.Title = title;
            log.ExtendedProperties = properties;

            Write(log);
        }

        #endregion

        #region Error

        /// <summary>
        /// Writes a new error log entry as defined in the <see cref="LogEntry"/> parameter.
        /// </summary>
        /// <param name="log">Log entry object to write.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteError(LogEntry log)
        {
            if (log != null)
            {
                log.Severity = TraceEventType.Error;

                Write(log);
            }
        }

        /// <summary>
        /// Writes a new error log entry to the default category.
        /// </summary>
        /// <param name="Format">Format string for the log message string.</param>
        /// <param name="Parameters">Parameters to format into the format string.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteErrorF(String Format, params Object[] Parameters)
        {
			Write(String.Format(Format, Parameters), EMPTYCATEGORYLIST, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Error, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new error log entry to the default category.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteError(object message)
        {
			Write(message, EMPTYCATEGORYLIST, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Error, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new error log entry to a specific category.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteError(object message, string category)
        {
            Write(message, category, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Error, DEFAULTTITLE, null);
        }

		/// <summary>
		/// Writes a new error log entry to a specific category.
		/// </summary>
		/// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
		/// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
		/// <param name="skipGlobalImplicitCategories">Skips to log into Global Implicit Categories for this log entry.</param>
		/// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
		public static void WriteError(object message, string category, bool skipGlobalImplicitCategories)
		{
			Write(message, category, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Error, DEFAULTTITLE, null, skipGlobalImplicitCategories);
		}

        /// <summary>
        /// Writes a new error log entry with a specific category and priority.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteError(object message, string category, int priority)
        {
            Write(message, category, priority, DEFAULTEVENTID, TraceEventType.Error, DEFAULTTITLE, null);
        }

        /// <summary>
        /// Writes a new error log entry with a specific category, priority and event id.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteError(object message, string category, int priority, int eventId)
        {
            Write(message, category, priority, eventId, TraceEventType.Error, DEFAULTTITLE, null);
        }

        /// <summary>
        /// Writes a new error log entry with a specific category, priority, event id, severity and title.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="title">Additional description of the log entry message</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteError(object message, string category, int priority, int eventId, string title)
        {
            Write(message, category, priority, eventId, TraceEventType.Error, title, null);
        }

        /// <summary>
        /// Writes a new error log entry and a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteError(object message, IDictionary<string, object> properties)
        {
			Write(message, EMPTYCATEGORYLIST, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Error, DEFAULTTITLE, properties, false);
        }

        /// <summary>
        /// Writes a new error log entry to a specific category with a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteError(object message, string category, IDictionary<string, object> properties)
        {
            Write(message, category, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Error, DEFAULTTITLE, properties);
        }

		/// <summary>
		/// Writes a new error log entry to a specific category with a dictionary of extended properties.
		/// </summary>
		/// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
		/// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
		/// <param name="properties">Dictionary of key/value pairs to log.</param>
		/// <param name="skipGlobalImplicitCategories">Skips to log into Global Implicit Categories for this log entry.</param>
		/// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
		public static void WriteError(object message, string category, IDictionary<string, object> properties, bool skipGlobalImplicitCategories)
		{
			Write(message, category, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Error, DEFAULTTITLE, properties, skipGlobalImplicitCategories);
		}

        /// <summary>
        /// Writes a new error log entry to with a specific category, priority and a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteError(object message, string category, int priority, IDictionary<string, object> properties)
        {
            Write(message, category, priority, DEFAULTEVENTID, TraceEventType.Error, DEFAULTTITLE, properties);
        }

        /// <summary>
        /// Writes a new error log entry with a specific category, priority, event Id, severity title and dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="title">Additional description of the log entry message.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteError(object message, string category, int priority, int eventId, string title, IDictionary<string, object> properties)
        {
			Write(message, new string[] { category }, priority, eventId, TraceEventType.Error, title, properties, false);
        }

        /// <summary>
        /// Writes a new error log entry to a specific collection of categories.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteError(object message, ICollection<string> categories)
        {
			Write(message, categories, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Error, DEFAULTTITLE, null, false);
        }

		/// <summary>
		/// Writes a new error log entry to a specific collection of categories.
		/// </summary>
		/// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
		/// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
		/// <param name="skipGlobalImplicitCategories">Skips to log into Global Implicit Categories for this log entry.</param>
		/// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
		public static void WriteError(object message, ICollection<string> categories, bool skipGlobalImplicitCategories)
		{
			Write(message, categories, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Error, DEFAULTTITLE, null, skipGlobalImplicitCategories);
		}

        /// <summary>
        /// Writes a new error log entry with a specific collection of categories and priority.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteError(object message, ICollection<string> categories, int priority)
        {
			Write(message, categories, priority, DEFAULTEVENTID, TraceEventType.Error, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new error log entry with a specific collection of categories, priority and event id.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteError(object message, ICollection<string> categories, int priority, int eventId)
        {
			Write(message, categories, priority, eventId, TraceEventType.Error, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new error log entry with a specific collection of categories, priority, event id, severity and title.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="title">Additional description of the log entry message</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteError(object message, ICollection<string> categories, int priority, int eventId, string title)
        {
			Write(message, categories, priority, eventId, TraceEventType.Error, title, null, false);
        }

        /// <summary>
        /// Writes a new error log entry to a specific collection of categories with a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteError(object message, ICollection<string> categories, IDictionary<string, object> properties)
        {
			Write(message, categories, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Error, DEFAULTTITLE, properties, false);
        }

        /// <summary>
        /// Writes a new error log entry to with a specific collection of categories, priority and a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteError(object message, ICollection<string> categories, int priority, IDictionary<string, object> properties)
        {
			Write(message, categories, priority, DEFAULTEVENTID, TraceEventType.Error, DEFAULTTITLE, properties, false);
        }

        /// <summary>
        /// Writes a new error log entry with a specific category, priority, event Id, severity title and dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="title">Additional description of the log entry message.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteError(object message, ICollection<string> categories, int priority, int eventId, string title, IDictionary<string, object> properties)
        {
            LogEntry log = new LogEntry();
            log.Message = message.ToString();
            log.Categories = categories;
            log.Priority = priority;
            log.EventId = eventId;
            log.Severity = TraceEventType.Error;
            log.Title = title;
            log.ExtendedProperties = properties;

            Write(log);
        }

        #endregion

        #region Info

        /// <summary>
        /// Writes a new information log entry as defined in the <see cref="LogEntry"/> parameter.
        /// </summary>
        /// <param name="log">Log entry object to write.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteInfo(LogEntry log)
        {
            if (log != null)
            {
                log.Severity = TraceEventType.Information;

                Write(log);
            }
        }

        /// <summary>
        /// Writes a new infomration log entry to the default category.
        /// </summary>
        /// <param name="Format">Format string for the log message string.</param>
        /// <param name="Parameters">Parameters to format into the format string.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteInfoF(String Format, params Object[] Parameters)
        {
			Write(String.Format(Format, Parameters), EMPTYCATEGORYLIST, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Information, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new information log entry to the default category.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteInfo(object message)
        {
			Write(message, EMPTYCATEGORYLIST, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Information, DEFAULTTITLE, null, false);
        }

		/// <summary>
		/// Writes a new information log entry to a specific category.
		/// </summary>
		/// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
		/// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
		/// <param name="skipGlobalImplicitCategories">Skips to log into Global Implicit Categories for this log entry.</param>
		/// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
		public static void WriteInfo(object message, string category, bool skipGlobalImplicitCategories)
		{
			Write(message, category, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Information, DEFAULTTITLE, null, skipGlobalImplicitCategories);
		}

		/// <summary>
        /// Writes a new information log entry to a specific category.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteInfo(object message, string category)
        {
            Write(message, category, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Information, DEFAULTTITLE, null);
        }

        /// <summary>
        /// Writes a new information log entry with a specific category and priority.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteInfo(object message, string category, int priority)
        {
            Write(message, category, priority, DEFAULTEVENTID, TraceEventType.Information, DEFAULTTITLE, null);
        }

        /// <summary>
        /// Writes a new information log entry with a specific category, priority and event id.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteInfo(object message, string category, int priority, int eventId)
        {
            Write(message, category, priority, eventId, TraceEventType.Information, DEFAULTTITLE, null);
        }

        /// <summary>
        /// Writes a new information log entry with a specific category, priority, event id, severity
        /// and title.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="title">Additional description of the log entry message</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteInfo(object message, string category, int priority, int eventId, string title)
        {
            Write(message, category, priority, eventId, TraceEventType.Information, title, null);
        }

        /// <summary>
        /// Writes a new information log entry and a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteInfo(object message, IDictionary<string, object> properties)
        {
			Write(message, EMPTYCATEGORYLIST, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Information, DEFAULTTITLE, properties, false);
        }

        /// <summary>
        /// Writes a new information log entry to a specific category with a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
		/// <param name="skipGlobalImplicitCategories">Skips to log into Global Implicit Categories for this log entry.</param>
		/// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
		public static void WriteInfo(object message, string category, IDictionary<string, object> properties, bool skipGlobalImplicitCategories)
        {
            Write(message, category, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Information, DEFAULTTITLE, properties);
        }

		/// <summary>
		/// Writes a new information log entry to a specific category with a dictionary of extended properties.
		/// </summary>
		/// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
		/// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
		/// <param name="properties">Dictionary of key/value pairs to log.</param>
		/// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
		public static void WriteInfo(object message, string category, IDictionary<string, object> properties)
		{
			Write(message, category, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Information, DEFAULTTITLE, properties);
		}

        /// <summary>
        /// Writes a new information log entry to with a specific category, priority and a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteInfo(object message, string category, int priority, IDictionary<string, object> properties)
        {
            Write(message, category, priority, DEFAULTEVENTID, TraceEventType.Information, DEFAULTTITLE, properties);
        }

        /// <summary>
        /// Writes a new information log entry with a specific category, priority, event Id, severity title and dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="title">Additional description of the log entry message.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteInfo(object message, string category, int priority, int eventId, string title, IDictionary<string, object> properties)
        {
			Write(message, new string[] { category }, priority, eventId, TraceEventType.Information, title, properties, false);
        }

        /// <summary>
        /// Writes a new information log entry to a specific collection of categories.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteInfo(object message, ICollection<string> categories)
        {
			Write(message, categories, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Information, DEFAULTTITLE, null, false);
        }

		/// <summary>
		/// Writes a new information log entry to a specific collection of categories.
		/// </summary>
		/// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
		/// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
		/// <param name="skipGlobalImplicitCategories">Skips to log into Global Implicit Categories for this log entry.</param>
		/// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
		public static void WriteInfo(object message, ICollection<string> categories, bool skipGlobalImplicitCategories)
		{
			Write(message, categories, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Information, DEFAULTTITLE, null, skipGlobalImplicitCategories);
		}

        /// <summary>
        /// Writes a new information log entry with a specific collection of categories and priority.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteInfo(object message, ICollection<string> categories, int priority)
        {
			Write(message, categories, priority, DEFAULTEVENTID, TraceEventType.Information, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new information log entry with a specific collection of categories, priority and event id.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        /// <param name="eventId">Event number or identifier.</param>
        public static void WriteInfo(object message, ICollection<string> categories, int priority, int eventId)
        {
			Write(message, categories, priority, eventId, TraceEventType.Information, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new information log entry with a specific collection of categories, priority, event id, severity and title.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="title">Additional description of the log entry message</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteInfo(object message, ICollection<string> categories, int priority, int eventId, string title)
        {
			Write(message, categories, priority, eventId, TraceEventType.Information, title, null, false);
        }

        /// <summary>
        /// Writes a new information log entry to a specific collection of categories with a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteInfo(object message, ICollection<string> categories, IDictionary<string, object> properties)
        {
			Write(message, categories, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Information, DEFAULTTITLE, properties, false);
        }

        /// <summary>
        /// Writes a new information log entry to with a specific collection of categories, priority and a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteInfo(object message, ICollection<string> categories, int priority, IDictionary<string, object> properties)
        {
			Write(message, categories, priority, DEFAULTEVENTID, TraceEventType.Information, DEFAULTTITLE, properties, false);
        }

        /// <summary>
        /// Writes a new information log entry with a specific category, priority, event Id, severity title and dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="title">Additional description of the log entry message.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteInfo(object message, ICollection<string> categories, int priority, int eventId, string title, IDictionary<string, object> properties)
        {
            LogEntry log = new LogEntry();
            log.Message = message.ToString();
            log.Categories = categories;
            log.Priority = priority;
            log.EventId = eventId;
            log.Severity = TraceEventType.Information;
            log.Title = title;
            log.ExtendedProperties = properties;

            Write(log);
        }

        #endregion

        #region Verbose

        /// <summary>
        /// Writes a new verbose log entry as defined in the <see cref="LogEntry"/> parameter.
        /// </summary>
        /// <param name="log">Log entry object to write.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteVerbose(LogEntry log)
        {
            if (log != null)
            {
                log.Severity = TraceEventType.Verbose;

                Write(log);
            }
        }

        /// <summary>
        /// Writes a new verbose log entry to the default category.
        /// </summary>
        /// <param name="Format">Format string for the log message string.</param>
        /// <param name="Parameters">Parameters to format into the format string.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteVerboseF(String Format, params Object[] Parameters)
        {
			Write(String.Format(Format, Parameters), EMPTYCATEGORYLIST, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Verbose, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new verbose log entry to the default category.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteVerbose(object message)
        {
			Write(message, EMPTYCATEGORYLIST, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Verbose, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new verbose log entry to a specific category.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteVerbose(object message, string category)
        {
            Write(message, category, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Verbose, DEFAULTTITLE, null);
        }

		/// <summary>
		/// Writes a new verbose log entry to a specific category.
		/// </summary>
		/// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
		/// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
		/// <param name="skipGlobalImplicitCategories">Skips to log into Global Implicit Categories for this log entry.</param>
		/// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
		public static void WriteVerbose(object message, string category, bool skipGlobalImplicitCategories)
		{
			Write(message, category, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Verbose, DEFAULTTITLE, null, skipGlobalImplicitCategories);
		}

        /// <summary>
        /// Writes a new verbose log entry with a specific category and priority.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteVerbose(object message, string category, int priority)
        {
            Write(message, category, priority, DEFAULTEVENTID, TraceEventType.Verbose, DEFAULTTITLE, null);
        }

        /// <summary>
        /// Writes a new verbose log entry with a specific category, priority and event id.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteVerbose(object message, string category, int priority, int eventId)
        {
            Write(message, category, priority, eventId, TraceEventType.Verbose, DEFAULTTITLE, null);
        }

        /// <summary>
        /// Writes a new verbose log entry with a specific category, priority, event id, severity and title.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="title">Additional description of the log entry message</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteVerbose(object message, string category, int priority, int eventId, string title)
        {
            Write(message, category, priority, eventId, TraceEventType.Verbose, title, null);
        }

        /// <summary>
        /// Writes a new verbose log entry and a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteVerbose(object message, IDictionary<string, object> properties)
        {
			Write(message, EMPTYCATEGORYLIST, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Verbose, DEFAULTTITLE, properties, false);
        }

		/// <summary>
		/// Writes a new verbose log entry and a dictionary of extended properties.
		/// </summary>
		/// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
		/// <param name="properties">Dictionary of key/value pairs to log.</param>
		/// <param name="skipGlobalImplicitCategories">Skips to log into Global Implicit Categories for this log entry.</param>
		/// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
		public static void WriteVerbose(object message, IDictionary<string, object> properties, bool skipGlobalImplicitCategories)
		{
			Write(message, EMPTYCATEGORYLIST, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Verbose, DEFAULTTITLE, properties, skipGlobalImplicitCategories);
		}

        /// <summary>
        /// Writes a new verbose log entry to a specific category with a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteVerbose(object message, string category, IDictionary<string, object> properties)
        {
            Write(message, category, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Verbose, DEFAULTTITLE, properties);
        }

        /// <summary>
        /// Writes a new verbose log entry to with a specific category, priority and a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteVerbose(object message, string category, int priority, IDictionary<string, object> properties)
        {
            Write(message, category, priority, DEFAULTEVENTID, TraceEventType.Verbose, DEFAULTTITLE, properties);
        }

        /// <summary>
        /// Writes a new verbose log entry with a specific category, priority, event Id, severity title and dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="title">Additional description of the log entry message.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteVerbose(object message, string category, int priority, int eventId, string title, IDictionary<string, object> properties)
        {
			Write(message, new string[] { category }, priority, eventId, TraceEventType.Verbose, title, properties, false);
        }

        /// <summary>
        /// Writes a new verbose log entry to a specific collection of categories.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteVerbose(object message, ICollection<string> categories)
        {
			Write(message, categories, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Verbose, DEFAULTTITLE, null, false);
        }

		/// <summary>
		/// Writes a new verbose log entry to a specific collection of categories.
		/// </summary>
		/// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
		/// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
		/// <param name="skipGlobalImplicitCategories">Skips to log into Global Implicit Categories for this log entry.</param>
		/// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
		public static void WriteVerbose(object message, ICollection<string> categories, bool skipGlobalImplicitCategories)
		{
			Write(message, categories, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Verbose, DEFAULTTITLE, null, skipGlobalImplicitCategories);
		}

        /// <summary>
        /// Writes a new verbose log entry with a specific collection of categories and priority.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteVerbose(object message, ICollection<string> categories, int priority)
        {
			Write(message, categories, priority, DEFAULTEVENTID, TraceEventType.Verbose, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new verbose log entry with a specific collection of categories, priority and event id.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteVerbose(object message, ICollection<string> categories, int priority, int eventId)
        {
			Write(message, categories, priority, eventId, TraceEventType.Verbose, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new verbose log entry with a specific collection of categories, priority, event id, severity and title.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="title">Additional description of the log entry message</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteVerbose(object message, ICollection<string> categories, int priority, int eventId, string title)
        {
			Write(message, categories, priority, eventId, TraceEventType.Verbose, title, null, false);
        }

        /// <summary>
        /// Writes a new verbose log entry to a specific collection of categories with a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteVerbose(object message, ICollection<string> categories, IDictionary<string, object> properties)
        {
			Write(message, categories, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Verbose, DEFAULTTITLE, properties, false);
        }

        /// <summary>
        /// Writes a new verbose log entry to with a specific collection of categories, priority and a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteVerbose(object message, ICollection<string> categories, int priority, IDictionary<string, object> properties)
        {
			Write(message, categories, priority, DEFAULTEVENTID, TraceEventType.Verbose, DEFAULTTITLE, properties, false);
        }

        /// <summary>
        /// Writes a new verbose log entry with a specific category, priority, event Id, severity title and dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="title">Additional description of the log entry message.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteVerbose(object message, ICollection<string> categories, int priority, int eventId, string title, IDictionary<string, object> properties)
        {
            LogEntry log = new LogEntry();
            log.Message = message.ToString();
            log.Categories = categories;
            log.Priority = priority;
            log.EventId = eventId;
            log.Severity = TraceEventType.Verbose;
            log.Title = title;
            log.ExtendedProperties = properties;

            Write(log);
        }

        #endregion

        #region Warning

        /// <summary>
        /// Writes a new warning log entry as defined in the <see cref="LogEntry"/> parameter.
        /// </summary>
        /// <param name="log">Log entry object to write.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteWarning(LogEntry log)
        {
            if (log != null)
            {
                log.Severity = TraceEventType.Warning;

                Write(log);
            }
        }

        /// <summary>
        /// Writes a new warning log entry to the default category.
        /// </summary>
        /// <param name="Format">Format string for the log message string.</param>
        /// <param name="Parameters">Parameters to format into the format string.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteWarningF(String Format, params Object[] Parameters)
        {
			Write(String.Format(Format, Parameters), EMPTYCATEGORYLIST, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Warning, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new warning log entry to the default category.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteWarning(object message)
        {
			Write(message, EMPTYCATEGORYLIST, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Warning, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new warning log entry to a specific category.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteWarning(object message, string category)
        {
            Write(message, category, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Warning, DEFAULTTITLE, null);
        }

		/// <summary>
		/// Writes a new warning log entry to a specific category.
		/// </summary>
		/// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
		/// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
		/// <param name="skipGlobalImplicitCategories">Skips to log into Global Implicit Categories for this log entry.</param>
		/// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
		public static void WriteWarning(object message, string category, bool skipGlobalImplicitCategories)
		{
			Write(message, category, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Warning, DEFAULTTITLE, null, skipGlobalImplicitCategories);
		}

        /// <summary>
        /// Writes a new warning log entry with a specific category and priority.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteWarning(object message, string category, int priority)
        {
            Write(message, category, priority, DEFAULTEVENTID, TraceEventType.Warning, DEFAULTTITLE, null);
        }

        /// <summary>
        /// Writes a new warning log entry with a specific category, priority and event id.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteWarning(object message, string category, int priority, int eventId)
        {
            Write(message, category, priority, eventId, TraceEventType.Warning, DEFAULTTITLE, null);
        }

        /// <summary>
        /// Writes a new warning log entry with a specific category, priority, event id, severity and title.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="title">Additional description of the log entry message</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteWarning(object message, string category, int priority, int eventId, string title)
        {
            Write(message, category, priority, eventId, TraceEventType.Warning, title, null);
        }

        /// <summary>
        /// Writes a new warning log entry and a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteWarning(object message, IDictionary<string, object> properties)
        {
			Write(message, EMPTYCATEGORYLIST, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Warning, DEFAULTTITLE, properties, false);
        }

		/// <summary>
		/// Writes a new warning log entry and a dictionary of extended properties.
		/// </summary>
		/// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
		/// <param name="properties">Dictionary of key/value pairs to log.</param>
		/// <param name="skipGlobalImplicitCategories">Skips to log into Global Implicit Categories for this log entry.</param>
		/// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
		public static void WriteWarning(object message, IDictionary<string, object> properties, bool skipGlobalImplicitCategories)
		{
			Write(message, EMPTYCATEGORYLIST, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Warning, DEFAULTTITLE, properties, skipGlobalImplicitCategories);
		}

        /// <summary>
        /// Writes a new warning log entry to a specific category with a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteWarning(object message, string category, IDictionary<string, object> properties)
        {
            Write(message, category, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Warning, DEFAULTTITLE, properties);
        }

        /// <summary>
        /// Writes a new warning log entry to with a specific category, priority and a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteWarning(object message, string category, int priority, IDictionary<string, object> properties)
        {
            Write(message, category, priority, DEFAULTEVENTID, TraceEventType.Warning, DEFAULTTITLE, properties);
        }

        /// <summary>
        /// Writes a new warning log entry with a specific category, priority, event Id, severity title and dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="category">Category name used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="title">Additional description of the log entry message.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteWarning(object message, string category, int priority, int eventId, string title, IDictionary<string, object> properties)
        {
			Write(message, new string[] { category }, priority, eventId, TraceEventType.Warning, title, properties, false);
        }

        /// <summary>
        /// Writes a new warning log entry to a specific collection of categories.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteWarning(object message, ICollection<string> categories)
        {
			Write(message, categories, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Warning, DEFAULTTITLE, null, false);
        }

		/// <summary>
		/// Writes a new warning log entry to a specific collection of categories.
		/// </summary>
		/// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
		/// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
		/// <param name="skipGlobalImplicitCategories">Skips to log into Global Implicit Categories for this log entry.</param>
		/// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
		public static void WriteWarning(object message, ICollection<string> categories, bool skipGlobalImplicitCategories)
		{
			Write(message, categories, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Warning, DEFAULTTITLE, null, skipGlobalImplicitCategories);
		}
		
		/// <summary>
        /// Writes a new warning log entry with a specific collection of categories and priority.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteWarning(object message, ICollection<string> categories, int priority)
        {
			Write(message, categories, priority, DEFAULTEVENTID, TraceEventType.Warning, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new warning log entry with a specific collection of categories, priority and event id.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteWarning(object message, ICollection<string> categories, int priority, int eventId)
        {
			Write(message, categories, priority, eventId, TraceEventType.Warning, DEFAULTTITLE, null, false);
        }

        /// <summary>
        /// Writes a new warning log entry with a specific collection of categories, priority, event id, severity and title.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="title">Additional description of the log entry message</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteWarning(object message, ICollection<string> categories, int priority, int eventId, string title)
        {
			Write(message, categories, priority, eventId, TraceEventType.Warning, title, null, false);
        }

        /// <summary>
        /// Writes a new warning log entry to a specific collection of categories with a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteWarning(object message, ICollection<string> categories, IDictionary<string, object> properties)
        {
			Write(message, categories, DEFAULTPRIORITY, DEFAULTEVENTID, TraceEventType.Warning, DEFAULTTITLE, properties, false);
        }

        /// <summary>
        /// Writes a new warning log entry to with a specific collection of categories, priority and a dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteWarning(object message, ICollection<string> categories, int priority, IDictionary<string, object> properties)
        {
			Write(message, categories, priority, DEFAULTEVENTID, TraceEventType.Warning, DEFAULTTITLE, properties, false);
        }

        /// <summary>
        /// Writes a new warning log entry with a specific category, priority, event Id, severity title and dictionary of extended properties.
        /// </summary>
        /// <param name="message">Message body to log.  Value from ToString() method from message object.</param>
        /// <param name="categories">Category names used to route the log entry to a one or more trace listeners.</param>
        /// <param name="priority">Only messages must be above the minimum priority are processed.</param>
        /// <param name="eventId">Event number or identifier.</param>
        /// <param name="title">Additional description of the log entry message.</param>
        /// <param name="properties">Dictionary of key/value pairs to log.</param>
        /// <exception cref="System.InvalidOperationException">Called before the initialization of <see cref="LogManager"/>.</exception>
        public static void WriteWarning(object message, ICollection<string> categories, int priority, int eventId, string title, IDictionary<string, object> properties)
        {
            LogEntry log = new LogEntry();
            log.Message = message.ToString();
            log.Categories = categories;
            log.Priority = priority;
            log.EventId = eventId;
            log.Severity = TraceEventType.Warning;
            log.Title = title;
            log.ExtendedProperties = properties;

            Write(log);
        }

        #endregion
    }
}
